package com.weitu.threeSimultaneities.occHealth.service.impl;

import com.weitu.threeSimultaneities.occHealth.entity.OccHealthAccept;
import com.weitu.threeSimultaneities.occHealth.mapper.OccHealthAcceptMapper;
import com.weitu.threeSimultaneities.occHealth.service.OccHealthAcceptService;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OccHealthAcceptServiceImpl implements OccHealthAcceptService {
    @Autowired
    private OccHealthAcceptMapper occHealthAcceptMapper;

    @Override
    public OccHealthAccept selectBySubjectId(String id) {
        return this.occHealthAcceptMapper.selectBySubjectId(id);
    }

    @Override
    public int deleteBySubjectId(String id) {
        return this.occHealthAcceptMapper.deleteBySubjectId(id);
    }

    @Override
    @Transactional
    public int insertSelective(Map<String,Object> paramMap) {
        this.occHealthAcceptMapper.deleteBySubjectId(paramMap.get("subjectId").toString());
        return this.occHealthAcceptMapper.insertSelective(paramMap);
    }
}